package LeetCode;

import java.util.Scanner;

public class LC_069_Sqrt_x {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int n = sc.nextInt();
            System.out.println(mySqrt(n));
        }
        sc.close();
    }

    private static int mySqrt(int x) {
        return (int) Math.sqrt(x);
    }

    public int mySqrt_2(int x) {
        long low = 0;
        long high = x / 2 + 1;
        long tmp;
        long mid;
        while (low <= high) {
            mid = (low + high) / 2;
            tmp = mid * mid;
            if (tmp == x)
                return (int) mid;
            else if (tmp > x)
                high = mid - 1;
            else if (tmp < x)
                low = mid + 1;
        }
        return (int) high;
    }
}
